﻿#include "FITKAbaOutputData.h"
#include <QMetaEnum>


Interface::FITKAbaOutputVariable::OutputFrequency Interface::AbaOutputData::getOutputFrequency() const
{
    return m_frequency;
}

void Interface::AbaOutputData::setOutputFrequency(FITKAbaOutputVariable::OutputFrequency value)
{
    m_frequency = value;
}

Interface::FITKAbaOutputVariable::OutputTiming Interface::AbaOutputData::getOutputTiming() const
{
    return m_timing;
}

void Interface::AbaOutputData::setOutputTiming(FITKAbaOutputVariable::OutputTiming value)
{
    m_timing = value;
}

Interface::FITKAbaOutputVariable::OutputVariablesSelectMode Interface::AbaOutputData::getSelectMode() const
{
    return m_selectMode;
}

void Interface::AbaOutputData::setSelectMode(FITKAbaOutputVariable::OutputVariablesSelectMode mode)
{
    m_selectMode = mode;
}

int Interface::AbaOutputData::getEveryNIncrements() const
{
    return m_n;
}

void Interface::AbaOutputData::setEvertyNIncrements(int value)
{
    m_n = value;
}

int Interface::AbaOutputData::getIntervals() const
{
    return m_intervals;
}

void Interface::AbaOutputData::setIntervals(int value)
{
    m_intervals = value;
}

double Interface::AbaOutputData::getXUnitsOfTime() const
{
    return m_x;
}

void Interface::AbaOutputData::setXUnitsOfTime(double value)
{
    m_x = value;
}

int Interface::AbaOutputData::getTimePointsId() const
{
    return m_timePointsId;
}

void Interface::AbaOutputData::setTimePointsId(int id)
{
    m_timePointsId = id;
}

QList<int> Interface::AbaOutputData::getModeList() const
{
    return m_modeList;
}

void Interface::AbaOutputData::setModeList(const QList<int> modes)
{
    m_modeList = modes;
}

QList<QString> Interface::AbaOutputData::getSelectedVariables() const
{
    return m_Variables;
}

void Interface::AbaOutputData::setSelectedVariables(const QList<QString>& vars)
{
    m_Variables = vars;
}

void Interface::AbaOutputData::appendVariable(const QString& var)
{
    QMetaEnum m = QMetaEnum::fromType<FITKAbaOutputVariable::OutputVariable>();
    bool ok{false};
    m.keyToValue(var.toLatin1().data(), &ok);
    if (!ok)
        return;
    if (!m_Variables.contains(var))
        m_Variables.append(var);
}

void Interface::AbaOutputData::removeVariable(const QString& var)
{
    m_Variables.removeOne(var);
}

void Interface::AbaOutputData::clearVariables()
{
    m_Variables.clear();
}
